package lesson01;

public class RandToRand {

    public static void main(String[] args) {
        System.out.println("测试开始：");
        for (int i = 0; i < 20; i++) {
            testRun();
        }
    }

    static void testRun(){
        int testTimes = 10000000; // 测试频次
        int count = 0;
        double temp = 0.75;

        for (int i = 0; i < testTimes; i++) {
            if(Math.random() < temp){
                count++;
            }
        }

        System.out.println((double)count/(double)testTimes);
    }
}
